// 请不要修改@light和@dark的值，当@light<@dark时启用亮色模式，否则启用暗色模式。

@light: 1;
@dark: 2;

// 主要色，请尽量选择亮度适中的颜色，即hsl值最后一个值尽量较大。
@theme-color: if((@light<@dark), hsl(0, 100%, 75%), hsl(195, 100%, 50%));
// 主要背景色
@base-bg: if((@light<@dark), hsl(0, 0%, 100%), hsl(0, 0%, 15%));
// 主要文字颜色
@base-text: if((@light<@dark), hsl(0, 0%, 5%), hsl(0, 0%, 75%));

:root {
    // 背景色组：依次是 背景色，写作区背景色，链接，高亮，代码，引用，代码块，表头，表体。
    --bg-color: @base-bg;
    --write-bg: @base-bg;
    --link-bg: none;
    --mark-bg: if((@light<@dark), lighten(@theme-color, 10%), darken(@theme-color, 10%));
    --code-bg: if((@light<@dark), lighten(@theme-color, 20%), #263238);
    --quota-bg: darken(@base-bg, 3%);
    --codeb-bg: if((@light<@dark), darken(@base-bg, 5%), #263238);
    --thead-bg: darken(@base-bg, 9%);
    --tbody-bg: darken(@base-bg, 7%);

    //文字颜色组：依次是 标题色，正文，高亮，引用，代码，代码块，脚注，链接。
    --title-color: if((@light<@dark), @base-text, lighten(@base-text, 15%));
    --text-color: if((@light<@dark), lighten(@base-text, 15%), @base-text);
    --mark-color: if((@light<@dark), lighten(@base-text, 15%), darken(@base-text, 45%));
    --quota-color: if((@light<@dark), lighten(@base-text, 25%), darken(@base-text, 25%));
    --code-color: if((@light<@dark), lighten(@base-text, 25%), @base-text);
    --codeb-color: if((@light<@dark), lighten(@base-text, 25%), darken(@base-text, 25%));
    --footer-color: if((@light<@dark), lighten(@base-text, 45%), darken(@base-text, 45%));
    --link-color: @theme-color;

    // markdown 符号颜色
    --md-char-color: lighten(@theme-color, 10%);
    --meta-content-color: lighten(@theme-color, 10%);

    // hover色
    --link-hover: lighten(@theme-color, 10%);
    --thead-hover: darken(@base-bg, 10%);
    --tbody-hover: darken(@base-bg, 10%);

    // 默认边框。l:left;b:bottom;
    --window-border: 1px solid hsl(0, 0%, 95%);
    --base-border: 1px solid lighten(@theme-color, 10%);
    --base-borderl: 4px solid lighten(@theme-color, 10%);
    --base-borderb: 1px dashed lighten(@theme-color, 10%);
    --opt-borderb: 1px dashed hsl(215, 100%, 65%);

    // 阴影：默认，可选，图片，代码块，引用。
    // --base-shadow: 0px 8px 16px hsla(0, 0%, 0%, .2);
    --opt-shadow: 0px 8px 16px 1px hsla(0, 0%, 0%, 0.3);
    --img-shadow: var(--opt-shadow);
    --code-shadow: none;
    --quota-shadow: none;

    // 间距：默认外边距，默认内边距，可选内边距，行高。
    --base-margin: 1rem auto;
    --base-padding: 1px 4px;
    --opt-padding: 1rem;
    --lineheight: 1.75rem;

    // 默认字体，标题，强调，引用，代码
    // 建议字体：raleway,lora,noto sans cjk,noto serif cjk,tw-kai,cascadia code
    --base-font: -apple-system, "Raleway Medium", "Noto Sans", "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;

    --title-font: var(--base-font);

    --em-font: "lora", Georgia, "Nimbus Roman No9 L", "Noto Serif CJK SC", "Songti SC", "Source Han Serif SC", "Source Han Serif CN", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;

    --quota-font: "eb garamond", Baskerville, Georgia, "Liberation Serif", "TW-Kai", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, DFKai-SB, "TW\-Kai", curve, serif;

    --monospace: "Cascadia code", Monaco, "Deja Vu Sans Mono", Consolas, "Lucida Console", "Andale Mono", Courier;

    // mermaid 字体
    --mermaid-alt-font-family: var(--base-font) !important;
    --mermaid-font-family: var(--base-font) !important;
}

*,
:after,
:before {
    box-sizing: border-box;
}

:after,
:before {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* 内外边距通常让各个浏览器样式的表现位置不同 */
body,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td,
hr,
button,
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
    margin: 0;
    padding: 0;
}

/* 重设 HTML5 标签, IE 需要在 js 中 createElement(TAG) */
article,
aside,
details,
figcaption,
figure,
footer,
header,
menu,
nav,
section {
    display: block;
}

/* HTML5 媒体文件跟 img 保持一致 */
audio,
canvas,
video {
    display: inline-block;
}

/* 要注意表单元素并不继承父级 font 的问题 */
body,
button,
input,
select,
textarea {
    font: 400 1em/1.75 var(--base-font);
}

button::-moz-focus-inner,
input::-moz-focus-inner {
    padding: 0;
    border: 0;
}

/* 去掉各Table cell 的边距并让其边重合 */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* 去除默认边框 */
fieldset,
img {
    border: 0;
}


html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: initial;
}

html,
body,
#write {
    font-family: var(--base-font);
    font-weight: 300;
    font-size: 16px;
    font-size: 1rem;
    line-height: var(--lineheight);
    color: var(--text-color);
    text-align: justify;
}

content {
    background: var(--bg-color);
    min-width: 400px;
}

.typora-node #write {
    min-height: calc(100vh - 6em);
}

#write {
    background: var(--write-bg);
    max-width: 914px;
    min-width: 400px;
    -webkit-font-smoothing: antialiased;
    margin: 2rem auto;
    padding: 2rem;
}

h1,
h2 {
    font-family: var(--title-font);
    font-weight: 300;
    line-height: 3rem;
    text-transform: uppercase;
}

#write h1 {
    font-size: 3rem;
    margin: 3rem auto 4rem;

    &::after {
        content: "";
        display: block;
        border-bottom: 1px solid var(--link-color);
        position: relative;
        top: 1.5rem;
        width: 50%;
    }
}

h2 {
    font-size: 2rem;
    margin: 2rem auto 1rem;
}

h3,
h4,
h5,
h6 {
    font-family: var(--base-font);
    font-weight: 400;
    margin: 2rem auto 1rem;
    position: relative;

    &:before {
        position: absolute;
        left: -2rem;
        font-size: .9rem;
        text-align: center;
        width: 1.5rem;
        vertical-align: middle;
        margin-right: .5rem;
        border-radius: 5px;
        background: @theme-color;
        color: var(--write-bg);
    }
}

h3 {
    font-size: 1.75rem;

    &:hover::before {
        content: "H3";
    }
}

h4 {
    font-size: 1.5rem;

    &:hover::before {
        content: "H4";
    }
}

h5,
h6 {
    font-size: 1.25rem;
}

h5:hover::before {
    content: "H5";
}

h6:hover::before {
    content: "H6";
}

// 块级元素
blockquote,
pre.md-fences,
pre.md-meta-block,
figure>table,
img {
    margin: var(--base-margin);
    border-radius: 5px;
    padding: var(--opt-padding);
}

ul,
ol {
    margin: var(--base-margin);
    margin-left: 2rem;
}

p+p {
    margin: .5rem auto;
}

// 行内元素
code,
mark,
kbd,
samp,
tt,
var,
ins {
    margin: 0 4px;
    padding: var(--base-padding);
    border-radius: 5px;
    font-family: var(--monospace);
}

// YAML
pre.md-meta-block {
    min-height: 30px;
    position: sticky;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

// codeblock
pre {
    white-space: pre;
}

pre.md-fences {
    display: block;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--code-shadow);
    white-space: pre;
}

pre.md-meta-block,
pre.md-fences,
code {
    line-height: 1.5rem;
    font-family: var(--monospace);
    font-size: .9rem;
    font-weight: 300;
    background-color: var(--codeb-bg);
    color: var(--codeb-color);
}

// code
code {
    background-color: var(--code-bg);
    color: var(--code-color);
    font-weight: 400;
    font-size: smaller;
}

// 超链接
a,
ins {
    background: var(--link-bg);
    color: var(--link-color);
}

#write a,
#write ins {
    text-decoration: none;
    border-bottom: var(--base-borderb);

    &:hover {
        border-bottom-color: var(--link-color);
        color: var(--link-hover);
        text-decoration: none;
    }
}

// 强调
strong,
em {
    font-family: var(--em-font);
    font-weight: 600;
    color: var(--title-color);
}

em {
    border-bottom: var(--opt-borderb);
    font-style: normal;
}

del {
    color: var(--footer-color);
}

//list
ul,
ol {

    li::marker {
        color: @theme-color;
    }
}

ul {
    list-style: disc;

    ul {
        list-style: circle;
    }
}

ol {
    list-style: decimal-leading-zero;

    ol {
        list-style: lower-roman;
    }
}

ol ol,
ul ul,
ol ul,
ul ol {
    margin-top: .5rem;
}

//blockquote
blockquote {
    background: var(--quota-bg);
    color: var(--quota-color);
    font-family: var(--quota-font);
    font-size: 1.2rem;
    box-shadow: var(--quota-shadow);
    background: var(--quota-bg);
    color: var(--quota-color);
    font-family: var(--quota-font);
    font-size: 1.2rem;
    box-shadow: var(--quota-shadow);

    blockquote {
        padding: 0;
        padding-left: 1rem;
        border-left: var(--base-borderl);
        box-shadow: none;
        border-radius: 0;
        box-shadow: none;
    }

    pre.md-fences {
        box-shadow: none;
    }

    p {
        color: var(--quota-color);
        font-family: var(--quota-font);
        line-height: var(--lineheight);
    }

    em,
    strong,
    mark,
    ins {
        font-size: 1rem;
    }
}

//img
img {
    box-shadow: var(--img-shadow);
    padding: 0;
    margin: 1rem !important;

    &[alt|="no-shadow"] {
        box-shadow: none !important;
    }

    &[alt|="normal"] {
        margin: 0 !important;
        box-shadow: none !important;
    }
}

//hr

hr {
    border: none;
    border-bottom: var(--base-border);
    margin: 3rem auto;
    height: 1px;
    width: 50%;

    .pb {
        page-break-after: always;
        border-bottom: none;
    }
}

//table

figure>table {
    width: 98%;
}

table {

    th,
    td {
        padding: .5rem 1rem;
    }

    thead tr {
        background: var(--thead-bg) !important;

        &:hover {
            background: var(--thead-hover) !important;
            color: var(--link-hover);
        }
    }

    caption {
        border-bottom: none;
    }

    tr {
        background: var(--write-bg);
        color: var(--text-color);
        border: 1px solid var(--thead-bg);

        &:nth-child(2n) {
            background: var(--tbody-bg);
        }

        &:hover {
            background: var(--tbody-hover);
            color: var(--link-hover);
        }

        th {
            border: 1px solid var(--thead-bg);
        }
    }
}

/*表格大小设置输入框(数字居中)*/
#write .md-grid-board-wrap input {
    text-align: center !important;
}

/*表格大小设置面板(防边界超出)*/
#write .popover.bottom.md-table-resize-popover {
    width: auto;
    max-width: none;
}

/*表格大小设置面板中的方框*/
#write .md-grid-board.md-reset>tbody>tr>td>a {
    border-bottom: 1px solid var(--table-border-color) !important;
}

// 表格设定面板位置下调
.ty-table-edit{
	margin-top: -16px!important;
}

sup.md-footnote {
    padding: var(--base-padding);
    color: var(--footer-color);
    cursor: pointer;
    font-size: .75rem;
}

//TODO list
.task-list-item input {
    &:before {
        content: "";
        position: relative;
        top: -1px;
        left: -5px;
        width: 20px;
        height: 20px;
        display: inline-block;
        vertical-align: middle;
        text-align: center;
        border: var(--base-border);
        background-color: var(--write-bg);
        margin-left: 0;
        margin-top: -0.5rem;
        border-radius: 50%;
        -webkit-transition: background-color 200ms ease-in-out;
        transition: background-color 200ms ease-in-out;
    }

    &::after {
        content: "";
        position: absolute;
        top: -1px;
        left: -2px;
        width: 1rem;
        height: 0.5rem;
        border: 2px solid #fff;
        border-top: 0;
        border-right: 0;
        -webkit-transform: rotate(-45deg);
        transform: rotate(-45deg);
        opacity: 0;
        -webkit-transition: opacity 200ms ease-in-out;
        transition: opacity 200ms ease-in-out;
    }

    &:checked {
        &::before {
            background: @theme-color;
            border: none;
        }

        &::after {
            opacity: 1;
        }
    }
}

// fix
.task-list-item {
    list-style: none;
}

.task-list-item p {
    text-indent: 5px !important;
}

.task-list-item input:checked:before,
.task-list-item input[checked]:before {
    content: " ";
}

.md-task-list-item.task-list-done {
    text-decoration: line-through;
    color: var(--footer-color);
}

blockquote .task-list-item input::before {
    top: -3px;
}

//codeblock style

.cm-s-inner .cm-header,
.cm-s-inner.cm-header {
    color: hsl(215, 100%, 75%);
}

@media screen and (max-width:600px) {
    #write {
        padding: 2rem;
        line-height: 1.5rem;

        h1,
        h2 {
            font-size: 1.5rem;
            text-align: left;
        }

        h3,
        h4,
        h5,
        h6 {
            font-size: 1rem;
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            margin: 1.5rem 0;

            &:before {
                display: inline;
                border: none;
                top: 0;
                margin-right: 1rem;
                background: none;
                color: lighten(@theme-color, 10%);
            }

            &::after {
                border: none;
            }
        }

        h1::before {
            content: "#";
        }

        h2::before {
            content: "##";
        }

        p+p {
            margin: 1rem auto;
        }

        pre.md-fences {
            padding: 1rem;
            box-shadow: none;
        }

        blockquote {
            background: var(--quota-bg);
            padding: 1rem;
            border-radius: 0;
            box-shadow: none;

            blockquote {
                padding-left: 1rem;
                margin: 1rem auto;
            }

            em,
            strong,
            mark {
                font-family: var(--quota-font);
            }
        }
    }
}

@media screen and (max-width:800px) {
    .md-toc {
        padding: 0;
        margin: 0 !important;
        max-width: 100%;

        &::before {
            display: block;
            position: relative;
            left: 0 !important;
            margin-top: 4rem;
            margin-bottom: 0;
            padding: 0;
            background: none;
        }

        .md-toc-content {
            top: 0;
            left: 0;

            .md-toc-h1 {
                margin-top: 2rem;
            }
        }
    }
}

@media screen and (max-width:1000px) {
    #write {
        margin: 0;
    }

    footer.ty-footer {
        background: var(--bg-color);
        border-top: 1px solid var(--bg-color);
    }
}

@media screen and (min-width:1300px) {
    #write {
        box-shadow: var(--base-shadow);
        border-radius: 5px;
        border: 1px solid if((@light<@dark), #efefef, #4d4d4d);
    }
}

@media print {

    @base-font: var(--em-font);
    @code-bg: hsl(0, 0%, 95%);

    html,
    body,
    #write {
        border: none;
        font-family: @base-font;
        font-size: 16px;
        font-size: 1rem;
        font-weight: 400;
        line-height: var(--lineheight);
    }

    .typora-export * {
        -webkit-print-color-adjust: exact;
    }

    #write {

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-weight: 600;
            margin: 2rem 0 1rem;
            color: #111;
            line-height: 2rem;
            font-family: @base-font;
        }

        h1 {
            font-size: 1.75rem;
            line-height: 2.5rem;

            &::after {
                display: none;
            }
        }

        h2 {
            font-size: 1.5rem;
        }

        h3,
        h4,
        h5,
        h6 {
            font-size: 1.25rem;
        }

        p {
            line-height: var(--lineheight);
            text-indent: 2rem;
        }

        .task-list-item input::before,
        .task-list-item input::after {
            top: 1px;
        }

        blockquote {
            position: relative;
            margin: 1rem 2rem;
            background: none;
            color: #555;
            font-weight: 300;

            li {
                font-family: var(--quota-font);
            }

            .task-list-item input::before {
                top: -1px;
            }

            blockquote {
                margin-right: 0;
                padding-right: 0;
            }
        }

        blockquote+blockquote {
            margin-bottom: 1rem;
        }

        pre.md-fences {
            background: @code-bg;
        }

        figure>table {
            background: none;
            margin: 1.75rem auto;

            tr {
                border-collapse: collapse;
                border-bottom: 1px solid brown;

                th,
                td {
                    padding: .5rem 0;
                }
            }
        }

        code,
        mark {
            padding: 2px;
            background: none;
        }

        mark {
            color: var(--text-color);
            background-color: hsl(60, 100%, 50%);
        }

    }



    //bugfix
    #write {
        box-shadow: none;
        border-radius: 0px;
        margin: 0;
        padding: 0;

        p+p {
            margin: 0;
        }

        blockquote,
        pre.md-fences,
        img {
            border: none;
            border-radius: 0;
            box-shadow: none;
        }

        blockquote {
            blockquote {
                border-left: none;
            }
        }

        mark {
            font-family: @base-font;
        }

        table {

            thead th,
            th,
            td {
                background: none;
                border: none;
                border-bottom: 1px solid #555;
            }
        }
    }
}

//ui for windows

:root {
    --blur-text-color: if((@light<@dark), lighten(@theme-color, 15%), darken(@theme-color, 15%));
    --active-file-bg-color: darken(@base-bg, 10%);
    /* 文件列表 当前文件激活 背景色*/
    --active-file-text-color: @theme-color;
    --active-file-border-color: @theme-color;
    /* 树形结构下文件激活边框色 */
    --side-bar-bg-color: darken(@base-bg, 5%);
    /*文件 大纲 侧边栏 背景色*/
    --item-hover-bg-color: darken(@base-bg, 10%);
    /* 打开文文件夹、正文菜单、最近使用 hover 效果 */
    --item-hover-text-color: @theme-color;

    --primary-color: @theme-color;
    /* color of primary buttons */
    --primary-btn-border-color: @theme-color;
    --primary-btn-text-color: @base-bg;

    --select-text-bg-color: @theme-color;
    --select-text-font-color: @base-bg;
    --active-bg: darken(@base-bg, 5%);
    --window-border: var(--bg-color);
    --control-text-color: var(--title-color);
    --control-text-hover-color: var(--text-color);
}

//sidebar

.active-tab-files,
.active-tab-outline {
    .info-panel-tab {
        color: var(--active-file-text-color);
    }
}

.file-list-item:hover {
    background: var(--item-hover-bg-color);
    color: var(--item-hover-text-color);
}

.file-node-content:hover {
    background: var(--active-file-bg-color);
    color: var(--active-file-text-color);
}

//serch-result
.ty-search-item-line {
    font-family: var(--base-font);
}

.ty-file-search-match-text {
    background: var(--codeb-bg);
}

/*搜索*/
#file-library-search-input {
    padding-left: 0.4em;
}

/* 大纲目录自动编号 */

.sidebar-content {

    counter-reset: h1;
}

.outline-h1 {
    counter-increment: h1;
    counter-reset: h2;
}

.outline-h2 {
    counter-increment: h2;
    counter-reset: h3;
}

.outline-h3 {
    counter-increment: h3;
    counter-reset: h4;
}

.outline-h4 {
    counter-increment: h4;
    counter-reset: h5;
}

.outline-h5 {
    counter-increment: h5;
    counter-reset: h6;
}

.outline-h1>.outline-item>.outline-label:before {
    content: "章"counter(h1) " ";
}

.outline-h2>.outline-item>.outline-label:before {
    content: "节"counter(h2) " ";
}

.outline-h3>.outline-item>.outline-label:before {
    content: counter(h3) " ";
}

.outline-h4>.outline-item>.outline-label:before {
    content: counter(h3) "."counter(h4) " ";
}

.outline-h5>.outline-item>.outline-label:before {
    content: counter(h3) "."counter(h4) "."counter(h5) " ";
}

.outline-h6>.outline-item>.outline-label:before {
    counter-increment: h6;
    content: counter(h3) "."counter(h4) "."counter(h5) "."counter(h6) " ";
}

//meta
.md-meta {
    font-family: var(--monospace);
    color: var(--md-char-color);
}

//meta-left,meta-right

.md-expand .md-meta.md-before,
.md-expand .md-meta.md-after {
    padding-left: 5px;
    padding-right: 5px;
}

.md-image>.md-meta {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    color: var(--meta-content-color);

    &:first-of-type:before {
        padding-left: 4px;
    }
}

.md-image>img {
    margin-top: 2px;
}

//context-menu,right-click

.dropdown-menu,
.context-menu.dropdown-menu>li>a:focus {
    background-color: var(--active-bg);
}

.context-menu.dropdown-menu>.active>a,
.context-menu.dropdown-menu>li>a:hover,
.menu-style-btn.active {
    color: var(--primary-color);
}

/* 源代码模式 */

#typora-source {
    background: var(--bg-color);
    color: var(--code-color);
    line-height: 1.5rem;
}

/* notification */

#md-notification {
    border-radius: 5px;
    background: transparent !important;

    &::after {
        content: "";
        display: block;
        position: absolute;
        left: 0;
        z-index: -111;
        backdrop-filter: blur(5px);
        top: 0;
        width: 100%;
        min-height: 5rem;
        -webkit-font-smoothing: antialiased;
        transition: opacity 1.2s cubic-bezier(.77, 0, .175, 1);
    }
}

/* focus mode */
.on-focus-mode .md-focus {
    padding: 1rem;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, .1);
    background: antiquewhite var(--bg-img);
    background-blend-mode: overlay;
    border-radius: 5px;
}

//megamenu

.megamenu-menu {
    box-shadow: if((@light<@dark), 2px 2px 5px 0 #33333380, 2px 2px 5px 0 #16161680);
}

.megamenu-menu-list {
    li {
        line-height: 48px;

        a {
            line-height: 48px;
            height: 48px;
        }
    }
}

.megamenu-menu,
#megamenu-menu-list {
    background: if((@light<@dark), #333, #1d1d1d);
}

.megamenu-menu-list li a.active,
.megamenu-menu-list:not(.saved) li a:hover {
    background: #00000033;
}

/* bugfix */
.megamenu-opened .megamenu-menu {
    left: -1px !important;
}

.megamenu-menu-list .saved #m-saved {
    display: block;
}

//megamenu-content

.megamenu-content {
    background: var(--bg-color) !important;

    h1,
    h2 {
        font-size: 2.5rem;
        margin: 2rem auto;
    }

    img {
        box-shadow: none;
    }

    .long-btn {
        text-align: left;
    }

    #megamenu-section-about {
        tr {
            background: var(--write-bg);
        }
    }

    #megamenu-section-theme {
        #theme-preview-grid {
            max-width: 90%;

            .theme-preview-div {
                width: 15rem;
                border: 4px solid #99999950;

                &:hover {
                    border-color: #80aaff80;
                }

                .theme-preview-content {
                    width: auto;
                }
            }

            .theme-preview-div.active,
            .theme-preview-div.active:hover {
                border-color: var(--primary-color);
            }
        }
    }
}

//preference
.nav-group-item.active {
    background: var(--side-bar-bg-color) !important;
    color: @theme-color;
}

//title
#top-titlebar,
#top-titlebar * {
    background-color: var(--bg-color);
    color: var(--text-color);
}

#top-titlebar {
    height: 28px;
    font-family: var(--base-font);
}

//scroll

::-webkit-scrollbar-corner {
    display: none;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    background-clip: padding-box;
}

[draggable] {
    cursor: pointer;
}

/* animation */

#write td,
#megamenu-content td,
.file-list-item,
.megamenu-menu li,
.btn,
.long-btn {
    position: relative;
    overflow: hidden;
}

#write td:after,
#megamenu-content td:after,
.file-list-item:after,
.megamenu-menu li:after,
.btn:after,
.long-btn:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #666 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .3s, opacity .5s;
}

#write td:active:after,
#megamenu-content td:active:after,
.file-list-item:active:after,
.megamenu-menu li:active:after,
.btn:active:after,
.long-btn:active:after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}

#typora-sidebar {

    #outline-content .outline-h1>.outline-item,
    .outline-title-wrapper,
    .outline-item-wrapper.outline-h1>.outline-item,
    .file-library-node,
    .file-library-node .file-node-background,
    #ty-sidebar-footer .sidebar-footer-item {
        transition: background 0.4s;
    }
}

//fix
.unibody-window,
.ty-preferences .windows,
uni-preference-panel,
.megamenu-content * :not(.fa) {
    font-family: var(--base-font);
}

#md-searchpanel.searchpanel-replace-mode {
    max-height: 80px;
}

.unibody-window #md-searchpanel .btn {
    line-height: 30px;
}

.cm-s-inner .CodeMirror-cursor {
    border-left: solid var(--link-color) !important;
}

#recent-file-panel tbody tr:nth-child(2n-1) {
    background-color: transparent;
}